#ifndef ODBC_TRANSACTION_POLICY_CONCEPT
#define ODBC_TRANSACTION_POLICY_CONCEPT

#include <boost/concept_check.hpp>
#include "odbc/details/os_sql_wrapper.hpp"

namespace odbc
{

/// \ingroup odbc
/// \brief It checks that a given transaction policy class conforms with the requirements of a transaction policy 
///		concept.
/// \param TransactionPolicy 
///		the transaction policy class to be checked for conformance with transaction policy concept.
/// \details
///		The transaction policy should provide methods for initializing the transaction support, committing and rolling 
///		back:
///		\li The setup method should accept the handle of the ODBC connection to be setup for transaction support. It 
///			should be compatible with the form <tt>static TransactionPolicy::setup( SQLHANDLE)</tt>
///		\li The commit method should accept the handle of the ODBC connection that owns the statements to be committed.
///			It should be compatible with the form <tt>static TransactionPolicy::commit( SQLHANDLE)</tt>
///		\li The rollback method should accept the handle of the ODBC connection that owns the statements to be rolled 
///			back. It should be compatible with the form <tt>static TransactionPolicy::rollback( SQLHANDLE)</tt>
template< class TransactionPolicy>
class transaction_policy_concept
{
public:
	BOOST_CONCEPT_USAGE( transaction_policy_concept)
	{
		TransactionPolicy::setup( (SQLHANDLE)0);	// Require method TransactionPolicy::setup( SQLHANDLE)
		TransactionPolicy::commit( (SQLHANDLE)0);	// Require method TransactionPolicy::commit( SQLHANDLE)
		TransactionPolicy::rollback( (SQLHANDLE)0);	// Require method TransactionPolicy::rollback( SQLHANDLE)

		bool dummy = (bool)TransactionPolicy::has_auto_commit;	// Require enumeration member has_auto_commit.
		dummy;
	}
};


} // namespace odbc

#endif // ODBC_TRANSACTION_POLICY_CONCEPT
